Skip to content

Launch IPython directly from package, instead of from path#307

Merged
stefanv merged 1 commit intoscientific-python:mainfrom
stefanv:ipython-use-sys-exec
Feb 6, 2026
Merged

Launch IPython directly from package, instead of from path#307
stefanv merged 1 commit intoscientific-python:mainfrom
stefanv:ipython-use-sys-exec

Conversation

@stefanv
Copy link
Member

@stefanv stefanv commented Jan 6, 2026

It happens, sometimes, that an install from a different version of Python is on the path. That leads to some unexepected and hard to debug issues.

This uses the -P flag which requires Python 3.11 (EOL for 3.10 is June 2026).

It happens, sometimes, that an install from a different version of
Python is on the path. That leads to some unexepected and hard to
debug issues.
@stefanv stefanv added the type: Enhancement New feature or request label Jan 6, 2026
Copy link
Contributor

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Stefan, tested with SciPy:

diff --git a/pixi.toml b/pixi.toml
index dbe3e87d0d..adb339bd20 100644
--- a/pixi.toml
+++ b/pixi.toml
@@ -143,9 +143,13 @@ features = ["build-deps", "run-deps", "test-deps", "scipy-openblas"]
 ### Default dependencies (included in all environments) ###

 [dependencies]
-spin = "*"
+# spin = "*"
 python = "*"

+[pypi-dependencies]
+spin.git = "https://github.com/stefanv/spin.git"
+spin.branch = "ipython-use-sys-exec"
scipy on 🎋 main [🔨] is 📦 v1.18.0.dev0 via 🐍 via 🧚 v0.63.2 took 33spixi ls spin
Name  Version       Build  Size  Kind  Source
spin  0.16rc0.dev0               pypi  git+https://github.com/stefanv/spin.git?branch=ipython-use-sys-exec#8106c9966eb286e62c7d3756399bc50bf881c7d5

scipy on 🎋 main [🔨] is 📦 v1.18.0.dev0 via 🐍 via 🧚 v0.63.2 took 2spixi run ipython
✨ Pixi task (build in build): spin build --setup-args=-Dblas=blas --setup-args=-Dlapack=lapack --setup-args=-Duse-g77-abi=true: (Build SciPy (default settings))
$ meson compile -j 8 -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /Users/lucascolley/ghq/github.com/scipy/scipy/.pixi/envs/build/bin/ninja -C /Users/lucascolley/ghq/github.com/scipy/scipy/build -j 8
ninja: Entering directory `/Users/lucascolley/ghq/github.com/scipy/scipy/build'
[2/356] Generating subprojects/highs/highs/HConfig.h with a custom command
$ meson install --only-changed -C build --destdir ../build-install --tags=runtime,python-runtime,tests,devel --skip-subprojects
✨ Pixi task (ipython in ipython): spin ipython --no-build: (Launch IPython)
$ export PYTHONPATH="/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages"
💻 Launching IPython with PYTHONPATH="/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages"
$ /Users/lucascolley/ghq/github.com/scipy/scipy/.pixi/envs/ipython/bin/python3.14 -P -m IPython --ignore-cwd
Python 3.14.2 | packaged by conda-forge | (main, Dec  6 2025, 11:34:40) [Clang 20.1.8 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.8.0 -- An enhanced Interactive Python. Type '?' for help.
Tip: You can use `%hist` to view history, see the options with `%history?`

In [1]: import scipy

In [2]: scipy.show_config()
/Users/lucascolley/ghq/github.com/scipy/scipy/build-install/usr/lib/python3.14/site-packages/scipy/__config__.py:166: UserWarning: Install `pyyaml` for better output
  warnings.warn("Install `pyyaml` for better output", stacklevel=1)
{
  "Compilers": {
    "c": {
      "name": "clang",
      "linker": "ld64",
      "version": "19.1.7",
      "commands": "/Users/lucascolley/ghq/github.com/scipy/scipy/.pixi/envs/build/bin/ccache, arm64-apple-darwin20.0.0-clang",

@stefanv stefanv merged commit 1713846 into scientific-python:main Feb 6, 2026
20 of 21 checks passed
@stefanv stefanv added this to the 0.15 milestone Feb 6, 2026
@stefanv
Copy link
Member Author

stefanv commented Feb 6, 2026

Thanks for testing, @lucascolley! This has been driving me insane, since my local setup someone has Python injected from the wrong place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants